package com.deyuanyun.pic.integalz.service.impl;

import java.util.Collections;
import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import com.deyuanyun.pic.business.controller.dto.PipeLineNewTaskVO;
import com.deyuanyun.pic.ctrl.controller.dto.exinsp.ExinspCipsDcvgDTO;
import com.deyuanyun.pic.ctrl.controller.dto.exinsp.ExinspPcmAcvgDTO;
import com.deyuanyun.pic.ctrl.domain.ExinspOclpoint;
import com.deyuanyun.pic.ctrl.mapper.ExinspTaskMapper;
import com.deyuanyun.pic.integalz.controller.dto.ExinspAcMiorRecordVO;
import com.deyuanyun.pic.integalz.controller.dto.ExinspCptestStationDTO;
import com.deyuanyun.pic.integalz.controller.dto.ExinspDcMiorRecordVO;
import com.deyuanyun.pic.integalz.controller.dto.ExinspOcgradeVO;
import com.deyuanyun.pic.integalz.controller.dto.IntegalzQueryVO;
import com.deyuanyun.pic.integalz.mapper.PipeLineExternalTaskMapper;
import com.deyuanyun.pic.integalz.service.PipeLineExternalTaskService;

@Service
public class PipeLineExternalTaskServiceImpl implements PipeLineExternalTaskService {


    private @Resource ExinspTaskMapper exinspTaskMapper;
    private @Resource PipeLineExternalTaskMapper pipeLineExternalTaskMapper;
    
    
    @Override
    public List<ExinspOclpoint> queryExinspOclpointCount(IntegalzQueryVO query,List<PipeLineNewTaskVO> exinspTaskList){
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        //得到该管道上指定距离内的外检任务对应的漏损点信息
        List<ExinspOclpoint> list = pipeLineExternalTaskMapper.queryExinspOclpoint(query, exinspTaskList);

        return list;
    }

    @Override
    public List<ExinspCptestStationDTO> queryExinspCptestStationCount(IntegalzQueryVO query,List<PipeLineNewTaskVO> exinspTaskList) {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        //得到管道上指定距离内的外检任务对应的测试桩检测数据
        List<ExinspCptestStationDTO>  list = pipeLineExternalTaskMapper.queryExinspCptestStation(query, exinspTaskList);

        return list;
    }

    @Override
    public List<ExinspOcgradeVO> queryExinspOcgradeCount(IntegalzQueryVO query, List<PipeLineNewTaskVO> exinspTaskList)  {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        //得到管道上指定距离内的外检任务对应的管道图层数据
        List<ExinspOcgradeVO> list = pipeLineExternalTaskMapper.queryExinspOcgrade(query,exinspTaskList);

        return list;
    }

    @Override
    public List<ExinspAcMiorRecordVO> queryExinspAcMiorRecord(@Param("query") IntegalzQueryVO query, @Param("exinspTaskList") List<PipeLineNewTaskVO> exinspTaskList) {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        //统计管道指定距离中最新任务对应的交流干扰监测记录
        List<ExinspAcMiorRecordVO> list = pipeLineExternalTaskMapper.queryExinspAcMiorRecord(query,exinspTaskList);

        return list;
    }

    @Override
    public List<ExinspDcMiorRecordVO> queryExinspDcMiorRecord(@Param("query") IntegalzQueryVO query, @Param("exinspTaskList") List<PipeLineNewTaskVO> exinspTaskList) {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        //统计管道指定距离中最新任务对应的直流干扰监测记录
        List<ExinspDcMiorRecordVO> list = pipeLineExternalTaskMapper.queryExinspDcMiorRecord(query,exinspTaskList);

        return list;
    }

    @Override
    public List<ExinspPcmAcvgDTO> queryExinspPcmAcvg(IntegalzQueryVO queryVO,List<PipeLineNewTaskVO> exinspTaskList) {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        List<ExinspPcmAcvgDTO> list = pipeLineExternalTaskMapper.queryExinspPcmAcvg(queryVO, exinspTaskList);
        return list;
    }

    @Override
    public List<ExinspCipsDcvgDTO> queryExinspCipsDcvg(IntegalzQueryVO queryVO,List<PipeLineNewTaskVO> exinspTaskList) {
        if(exinspTaskList == null || exinspTaskList.isEmpty()){
            return Collections.emptyList();
        }
        List<ExinspCipsDcvgDTO> list = pipeLineExternalTaskMapper.queryExinspCipsDcvg(queryVO, exinspTaskList);
        return list;
    }

    
    
    
}
